import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
//切换请求本地数据还是网络数据 false 本地  true 网络
var hostflag =false;
const state = {
  count: 0,
  host:hostflag?"http://localhost:3000":'http://local',
  username:"jean"
}

const mutations = {
  increment :function(state,mydata) {
    state.count=mydata
  },
  setusername:function(state,mydata){
    state.username = mydata
  }
};
const actions = {
};

const getters = {
  
};

export default new Vuex.Store({
  state:state,
  getters:getters,
  actions:actions,
  mutations:mutations
})
